<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-touch-fullscreen" content="yes" />
		<meta name="format-detection" content="telephone=no"/>
		<meta name="apple-mobile-web-app-status-bar-style" content="black" /> 
		<meta name="msapplication-tap-highlight" content="no" />
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width, viewport-fit=cover" />
		<title>启蒙优选-设置</title>
		<link rel="stylesheet" href="__TMPL__/home/public/assets/css/style.css?v=0630" />
		<link rel="stylesheet" href="__TMPL__/home/public/assets/css/swiper.min.css">
	</head>
	<style>
		.loginMask .loginBox img.close{width:1rem;height:1rem;position:absolute;bottom:-1.4rem;left:50%;margin-left:-.5rem;}
	</style>
	<body>
		<!-- 个人中心 --> 
		<div class="setClassIndex">
			<div class="content">
				<!-- <div class="order_top">
					<div class="title flex juscbtween">
						<a href="javascript:history.go(-1);" class="flex alitemCenter"><img src="__TMPL__/home/public/assets/img/back.png" alt=""></a>
						<b>设置</b>
						<span></span>
					</div>
				</div> -->

				<div class="setList">
					<div class="list">
						<div class="item flex juscbtween">
							<b>头像</b>
							<img src="{$meminfo['logo']}" alt="" class="head">
						</div>
						<a class="item flex juscbtween" href="{:url('/set_name')}">
							<b>昵称</b>
							<div class="right flex alitemCenter">
								<span>{$meminfo['nickname']}</span>
								<img src="__TMPL__/home/public/assets/img/right.png" alt="">
							</div>
						</a>
					</div>
					<div class="list">
						<a class="item flex juscbtween hide" href="{:url('member/setPhone')}">
							<b>手机号</b>
							<div class="right flex alitemCenter">
								<span>{$meminfo['mobile']}</span>
								<img src="__TMPL__/home/public/assets/img/right.png" alt="">
							</div>
						</a>
						<a class="item flex juscbtween setBabyInfo" href="javascript:;">
							<b>设置宝宝信息</b>
							<div class="right flex alitemCenter">
								<span></span>
								<img src="__TMPL__/home/public/assets/img/right.png" alt="">
							</div>
						</a>
						<a class="item flex juscbtween" href="{:url('/set_wx')}">
							<b>设置社交信息</b>
							<div class="right flex alitemCenter">
								<span></span>
								<img src="__TMPL__/home/public/assets/img/right.png" alt="">
							</div>
						</a>
						<div class="item flex juscbtween hide">
							<b>关于我们</b>
							<div class="right flex alitemCenter">
								<img src="__TMPL__/home/public/assets/img/right.png" alt="">
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- 设置宝宝信息 -->
			<div class="loginMask hideThis close">
				<div class="loginBox bubbling">
					<h3>完善信息，可以获得更精准的推荐</h3>
					<div class="sexBox flex juscenter">
						<div class="sexItem" data-sex="女"><img src="__TMPL__/home/public/assets/img/index/girl.png" alt=""><p>小公主</p></div>
						<div class="sexItem" data-sex="男"><img src="__TMPL__/home/public/assets/img/index/boy.png" alt=""><p>小王子</p></div>
					</div>
					<div class="baby_info flex juscbtween">
						<b>宝宝昵称</b>
						<input type="text" placeholder="请输入宝宝名" class="babyName">
					</div>
					<div class="baby_info flex juscbtween">
						<b>宝宝生日</b>
						<input type="text" id="dateSelectorOne" readonly="readonly" placeholder="请选择宝宝生日">
					</div>
					<button id="submitBabySex">确定</button>
					<img src="__TMPL__/home/public/assets/img/close.png" class="close" alt="">
				</div>
			</div>
		</div>
	</body>
	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/jquery-2.0.3.min.js"></script>
	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/layer/layer.js"></script>
	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/iScroll.js"></script>
	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/Mdate.js"></script>
  	<script rel="stylesheet" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  	<script rel="stylesheet" src="__TMPL__/home/public/assets/js/base.js"></script>
	<script>
		$(function(){
			$('.setBabyInfo').click(function(){
				$('.loginMask').show();
			})
			$('.close').click(function(){
				$('.loginMask').hide();
			})
			$('.bubbling').click(function(){
				return false;
			})
		    //选择性别选中状态
		    $('.sexItem').click(function(){
		    	$(this).siblings().find('p').removeClass('on');
		    	$(this).find('p').addClass('on');
		    })
		    //时间选择
		    new Mdate("dateSelectorOne");

		    var baby_sex;
		    //选择性别选中状态
		    $('.sexItem').click(function(){
		    	$(this).siblings().find('p').removeClass('on');
		    	baby_sex = $(this).attr('data-sex');
		    	$(this).find('p').addClass('on');
		    })
		    //设置宝宝信息
		    $('#submitBabySex').click(function(){
		    	var baby_name = $('.babyName').val();
		    	var baby_birthday = $('.babyName').val();
		    	if(!baby_name){
		    		return layer.msg('请输入宝宝名');
		    	}else if(!baby_birthday){
		    		return layer.msg('请选择宝宝生日');
		    	}else if(!baby_sex){
		    		return layer.msg('请选择宝宝性别');
		    	}
		        $.ajax({
		          	url: '/one_setuser',
		          	type: 'POST',
		          	data: {baby_name:baby_name,baby_birthday:baby_birthday,baby_sex:baby_sex},
		        }).done(function(res) {
		          	if(res.code == 200){
		           		var data = res.data;
		           		layer.msg('设置成功！');
		           		$('.loginMask').hide();
		          	}else{
		                layer.msg(res.msg);
		          	}
		        }).fail(function(err) {
		            layer.msg(err.msg);
		        })
		    })
		})
	</script>
</html>
